var actionPri = "";
var path = $("#webPath").val();
path=(path==null?basePath:path);
$.ajax({
	url:path+"/sys/privilege_management/findActionPri.do",
	type:"post",
	dataType: 'json',
	async:false,
	data:{
		"url":window.location.href
	},
	error:function(data){
    	layer.msg('操作权限获取失败',{time:2000});
    	$(".add_action").hide();
    	$(".edit_action").hide();
    	$(".del_action").hide();
    },
	success:function(result){
		actionPri = result.actionPri;
	}
	
});

$(function(){
	//
	hideBtn();
})

function hideBtn(){
	$(".add_action").hide();
	$(".edit_action").css('display','none'); 
	$(".del_action").hide();
	if(actionPri.indexOf("2")==-1&&actionPri.indexOf("3")==-1){
		var number  = $("#pageTable .operation").length;
		if(number!=0){
			var operation_number = $($("#pageTable .operation").get(0)).children("i").length
			if(operation_number==2){
				$(".operation").hide();
			}
		}
	}
	//操作按钮数量
	if(actionPri.indexOf("1")>-1){
		$(".add_action").show();
	}
	if(actionPri.indexOf("2")>-1){
		$(".edit_action").show();
	}
	if(actionPri.indexOf("3")>-1){
		$(".del_action").show();
	}
}

	